package plugs

import (
	"fmt"

	"gitee.com/wu-jin-feng/kinfu/fgin"
	"github.com/gin-gonic/gin"
)

func init() {
	fgin.RegisteHttpPlug("my_midd", &MyMidd{})
}

type MyMidd struct {
	ServiceName string `yaml:"service_name" json:"service_name"`
}

func (c *MyMidd) Start(r *gin.Engine, logger *fgin.FginSugaredLogger) {
	fmt.Println("my middware start11", c)
	r.Use(func(ctx *gin.Context) {
		fmt.Println("进入中间件：", c.ServiceName)
		ctx.Next()
	})
}
